const express = require('express')
const router = express.Router()
// 导入用户路由处理函数模块
const userHandler = require('../router_handler/userinfo')
const userList = require('../router_handler/userlist')

// 1. 导入验证表单数据的中间件
const expressJoi = require('@escook/express-joi')
// 2. 导入需要的验证规则对象
const { reg_updatepwd_schema } = require('../schema/user')
// 获取用户信息


router.get('/userinfo', userHandler.getUserInfo)
// 更新用户信息
router.post('/edituserinfo', userHandler.editUserInfo)
// 重置密码
router.post('/updatepwd', expressJoi(reg_updatepwd_schema), userHandler.updatePassword)


// 获取所有用户的报名信息
router.get('/getuserinfolist', userList.getuserinfolist)
// 根据手机号获取用户信息
router.post('/getuserinfoformphone', userList.getuserinfoformphone)


// 修改报名信息
router.post('/edituserinfolist', userList.edituserinfolist)


// 删除报名信息
router.post('/deleteuserinfolist', userList.deleteuserinfolist)
module.exports = router